/******************************************************************************
*
* Copyright (C) FMSH, Corp.  All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* FMSH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the FMSH shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from FMSH.
*
******************************************************************************/
/*****************************************************************************/
/**
*
* @file fmsh_qspips_sw.h
* @addtogroup qspips_v1_0
* @{
*
* This header file used to contains the identifiers and user used driver
* functions (or macros) that can be used to access the device.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver   Who Date     Changes
* ----- --- -------- -----------------------------------------------
* 1.00  hzq 7/1/19 
* 		     First release
*
* </pre>
*
******************************************************************************/
#ifndef _FMSH_QSPIPS_SW_H_	/* prevent circular inclusions */ 
#define _FMSH_QSPIPS_SW_H_	/* by using protection macros */

#ifdef __cplusplus
extern "C" {
#endif
    
/**********************************Include File*********************************/

/**********************************Constant Definition**************************/
    
/**********************************Type Definition******************************/

/**********************************Macro (inline function) Definition***********/

/**********************************Variable Definition**************************/
    
/**********************************Function Prototype***************************/
int FQspiPs_Initialize(FQspiPs_T* qspi, u16 deviceId);
int FQspiPs_GetFlashInfo(FQspiPs_T* qspi);
int FQspiPs_SetFlashMode(FQspiPs_T* qspi, u8 cmd);
int FQspiPs_ResetFlash(FQspiPs_T* qspi);
int FQspiPs_EnableQuad(FQspiPs_T* qspi);
int FQspiPs_UnlockFlash(FQspiPs_T* qspi);
int FQspiPs_SetFlashSegment(FQspiPs_T* qspi, u8 highAddr);
int FQspiPs_EraseChip(FQspiPs_T* qspi);
int FQspiPs_EraseSectors(FQspiPs_T* qspi, u32 offset, u32 byteCount, u32 sectorSize);
int FQspiPs_SendBytes(FQspiPs_T* qspi, u32 offset, u32 byteCount, u8* sendBuffer);
int FQspiPs_RecvBytes(FQspiPs_T* qspi, u32 offset, u32 byteCount, u8* recvBuffer);
int FQspiPs_FastSendBytes(FQspiPs_T* qspi, u32 offset, u32 byteCount, u8* sendBuffer);
int FQspiPs_FastRecvBytes(FQspiPs_T* qspi, u32 offset, u32 byteCount, u8* recvBuffer);
int FQspiPs_EnterXIP(FQspiPs_T* qspi, u8 cmd);
int FQspiPs_IsFlashQuad(FQspiPs_T* qspi);
#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* prevent circular inclusions */